<?php

namespace common\models;

use Yii;
use \common\models\base\InvitationCode as BaseInvitationCode;

/**
 * This is the model class for table "invitation_code".
 * @property Authority[] $auths
 */
class InvitationCode extends BaseInvitationCode
{
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return array_replace_recursive(parent::rules(),
	    [

        ]);
    }

    protected $_characterId = '';

    public function getCharacterId()
    {
        if (!$this->_characterId) {
            $this->_characterId = $this->generate?$this->generate->character_id:'';
        }
        return $this->_characterId;
    }

    protected $_auths = [];

    public function getAuths()
    {
        if (!$this->_auths){
            $this->_auths = $this->generate?$this->generate->character->summitInformation:[SummitInformation::getBasic()];
        }
        return $this->_auths;
    }

    protected $_character;

    public function getCharacter()
    {
        if (!$this->_character){
            $this->_character = $this->generate?$this->generate->character:new Character();
        }
        return $this->_character;
    }

    protected $_charName;

    public function getCharName()
    {
        if (!$this->_charName){
            $this->_charName = $this->generate?$this->generate->charName:'';
        }
        return $this->_charName;
    }


}
